home *** CD-ROM | disk | FTP | other *** search
/ The Arsenal Files 6 / The Arsenal Files 6 (Arsenal Computer).ISO / sync / xsdk_241.zip / XSDKDEFS.H < prev    next >
C/C++ Source or Header  |  1995-10-30  |  10KB  |  248 lines

  1. /* XSDKDEFS.H */
  2.  
  3. #ifndef _XSDKDEFS_H
  4. #define _XSDKDEFS_H
  5.  
  6. /**********/
  7. /* Macros */
  8. /**********/
  9.                                     /* Control characters */
  10. #define STX     0x02                /* Start of text            ^B    */
  11. #define ETX     0x03                /* End of text                ^C    */
  12. #define BS        0x08                /* Back space                ^H    */
  13. #define TAB     0x09                /* Horizontal tabulation    ^I    */
  14. #define LF        0x0a                /* Line feed                ^J    */
  15. #define FF        0x0c                /* Form feed                ^L    */
  16. #define CR        0x0d                /* Carriage return            ^M    */
  17. #define ESC     0x1b                /* Escape                    ^[    */
  18. #define SP      0x20                /* Space                        */
  19.  
  20.  
  21. #define DCD    0x8000        /* Data carrier detect bit in msr            */
  22.  
  23. #define TABSIZE     4        /* Tabs will expand to 4 chars upon input    */
  24.  
  25. #define SAVE_LINES     4        /* Maximum number of lines to save            */
  26. #define LINE_BUFSIZE 512    /* Size of line output buffer               */
  27.  
  28. #define HIGH 8                /* High intensity attribute bit */
  29.  
  30.                             /* user_misc bits */
  31. #define ANSI    (1<<0)        /* user has ANSI capability */
  32. #define COLOR    (1<<1)        /* user has monochrome ANSI display */
  33. #define RIP     (1<<2)        /* RIP compatible terminal detected */
  34. #define WIP     (1<<3)        /* WIP compatible terminal detected */
  35.  
  36. #ifndef uchar                /* Short-hand for unsigned data types */
  37. #define uchar unsigned char
  38. #endif
  39. #ifndef uint
  40. #define uint unsigned int
  41. #endif
  42. #ifndef ushort
  43. #define ushort unsigned short
  44. #endif
  45. #ifndef ulong
  46. #define ulong unsigned long
  47. #endif
  48.  
  49.                             /* Bits in 'mode' for getkey and getstr     */
  50. #define K_UPPER        (1<<0)    /* Converts all letters to upper case         */
  51. #define K_UPRLWR    (1<<1)  /* Upper/Lower case automatically           */
  52. #define K_NUMBER    (1<<2)  /* Allow numbers only                       */
  53. #define K_WRAP        (1<<3)  /* Allows word wrap                            */
  54. #define K_MSG        (1<<4)  /* Allows ANSI, ^N ^A ^G                    */
  55. #define K_SPIN      (1<<5)  /* Spinning cursor (same as SPIN)           */
  56. #define K_LINE      (1<<6)  /* Input line (inverse color)               */
  57. #define K_EDIT      (1<<7)  /* Edit string passed                       */
  58. #define K_CHAT        (1<<8)    /* In chat multi-chat                         */
  59. #define K_NOCRLF    (1<<9)    /* Don't print CRLF after string input      */
  60. #define K_ALPHA     (1<<10) /* Only allow alphabetic characters         */
  61. #define K_AUTODEL    (1<<11) /* Auto-delete text (used with K_EDIT)        */
  62. #define K_LOWPRIO    (1<<12) /* Low priority getstr() operation            */
  63. #define K_GETSTR    (1<<13) /* getkey() called from getstr()            */
  64.  
  65.                             /* Miscellaneous Modem Settings (mdm_misc)    */
  66. #define MDM_FLOWCTRL (1<<0)    /* Use flow control with modem                */
  67. #define MDM_STAYHIGH (1<<1) /* Stay at highest DTE rate                 */
  68.  
  69. #define LOOP_NOPEN   50        /* Retries before file access denied        */
  70. #define LOOP_NODEDAB 100    /* Retries on NODE.DAB locking/unlocking    */
  71.  
  72. #define MAX_NODES    250     /* Maximum number of nodes                    */
  73.  
  74. enum {                                /* Node Status */
  75.      NODE_WFC                        /* Waiting for Call */
  76.     ,NODE_LOGON                      /* at logon prompt */
  77.     ,NODE_NEWUSER                     /* New user applying */
  78.     ,NODE_INUSE                         /* In Use */
  79.     ,NODE_QUIET                         /* In Use - quiet mode */
  80.     ,NODE_OFFLINE                     /* Offline */
  81.     ,NODE_NETTING                     /* Networking */
  82.     ,NODE_EVENT_WAITING                /* Waiting for all nodes to be inactive */
  83.     ,NODE_EVENT_RUNNING                /* Running an external event */
  84.     ,NODE_EVENT_LIMBO                /* Allowing another node to run an event */
  85.     };
  86.  
  87.                                     /* Bit values for node.misc */
  88. #define    NODE_ANON    (1<<0)            /* Anonymous User */
  89. #define    NODE_LOCK    (1<<1)            /* Locked for sysops only */
  90. #define    NODE_INTR    (1<<2)            /* Interrupted - hang up */
  91. #define NODE_MSGW   (1<<3)            /* Message is waiting */
  92. #define NODE_POFF   (1<<4)            /* Page disabled */
  93. #define NODE_AOFF    (1<<5)            /* Activity Alert disabled */
  94. #define NODE_UDAT    (1<<6)            /* User data has been updated */
  95. #define NODE_RRUN    (1<<7)            /* Re-run this node when log off */
  96. #define NODE_EVENT    (1<<8)            /* Must run node event after log off */
  97. #define NODE_DOWN    (1<<9)            /* Down this node after logoff */
  98. #define NODE_RPCHT    (1<<10)         /* Reset private chat */
  99. #define NODE_NMSG   (1<<11)         /* Node message waiting (new way) */
  100.  
  101.  
  102. enum {                                /* Node Action */
  103.      NODE_MAIN                        /* Main Prompt */
  104.     ,NODE_RMSG                         /* Reading Messages */
  105.     ,NODE_RMAL                        /* Reading Mail */
  106.     ,NODE_SMAL                         /* Sending Mail */
  107.     ,NODE_RTXT                         /* Reading G-Files */
  108.     ,NODE_RSML                         /* Reading Sent Mail */
  109.     ,NODE_PMSG                         /* Posting Message */
  110.     ,NODE_AMSG                         /* Auto-message */
  111.     ,NODE_XTRN                          /* Running External Program */
  112.     ,NODE_DFLT                          /* Main Defaults Section */
  113.     ,NODE_XFER                           /* Transfer Prompt */
  114.     ,NODE_DLNG                        /* Downloading File */
  115.     ,NODE_ULNG                        /* Uploading File */
  116.     ,NODE_BXFR                        /* Bidirectional Transfer */
  117.     ,NODE_LFIL                        /* Listing Files */
  118.     ,NODE_LOGN                        /* Logging on */
  119.     ,NODE_LCHT                        /* In Local Chat with Sysop */
  120.     ,NODE_MCHT                         /* In Multi-Chat with Other Nodes */
  121.     ,NODE_GCHT                           /* In Local Chat with Guru */
  122.     ,NODE_CHAT                           /* In Chat Section */
  123.     ,NODE_SYSP                         /* Sysop Activity */
  124.     ,NODE_TQWK                        /* Transferring QWK packet */
  125.     ,NODE_PCHT                        /* Private node-to-node chat */
  126.     ,NODE_PAGE                        /* Paging node for Private Chat */
  127.     ,NODE_RFSD                        /* Retrieving file from sequential dev */
  128.     };
  129.  
  130.                             /* Different bits in node_misc                */
  131. #define NM_ANSALARM (1<<0)    /* Alarm locally on answer                    */
  132. #define NM_WFCSCRN  (1<<1)    /* Wait for call screen                     */
  133. #define NM_WFCMSGS    (1<<2)    /* Include total messages/files on WFC        */
  134. #define NM_LCL_EDIT (1<<3)    /* Use local editor to create messages        */
  135. #define NM_EMSOVL    (1<<4)    /* Use expanded memory of overlays            */
  136. #define NM_WINOS2    (1<<5)    /* Use Windows/OS2 time slice API call        */
  137. #define NM_INT28    (1<<6)    /* Make int 28 DOS idle calls                */
  138. #define NM_NODV     (1<<7)    /* Don't detect and use DESQview API        */
  139. #define NM_NO_NUM    (1<<8)    /* Don't allow logons by user number        */
  140. #define NM_LOGON_R    (1<<9)    /* Allow logons by user real name            */
  141. #define NM_LOGON_P    (1<<10) /* Secure logons (always ask for password)    */
  142. #define NM_NO_LKBRD (1<<11) /* No local keyboard (at all)                */
  143. #define NM_SYSPW    (1<<12) /* Protect WFC keys and Alt keys with SY:    */
  144. #define NM_NO_INACT (1<<13) /* No local inactivity alert/logoff         */
  145. #define NM_NOBEEP    (1<<14) /* Don't beep locally                       */
  146. #define NM_LOWPRIO    (1<<15) /* Always use low priority input            */
  147. #define NM_7BITONLY (1L<<16) /* Except 7-bit input only (E71 terminals)  */
  148.  
  149. #ifdef __WATCOMC__
  150.  
  151.     #if !defined(__COLORS)
  152.     #define __COLORS
  153.  
  154.     enum COLORS {
  155.         BLACK,            /* dark colors */
  156.         BLUE,
  157.         GREEN,
  158.         CYAN,
  159.         RED,
  160.         MAGENTA,
  161.         BROWN,
  162.         LIGHTGRAY,
  163.         DARKGRAY,        /* light colors */
  164.         LIGHTBLUE,
  165.         LIGHTGREEN,
  166.         LIGHTCYAN,
  167.         LIGHTRED,
  168.         LIGHTMAGENTA,
  169.         YELLOW,
  170.         WHITE
  171.     };
  172.     #endif
  173.  
  174.     #define BLINK        128 /* blink bit */
  175.  
  176.     #define ffblk find_t
  177.     #define findfirst(x,y,z) _dos_findfirst(x,z,y)
  178.     #define findnext(x) _dos_findnext(x)
  179.     #pragma aux mswait "_*"
  180. #endif
  181.  
  182. /****************************************************************************/
  183. /* MALLOC/FREE Macros for various compilers and environments                */
  184. /* MALLOC is used for allocations of 64k or less                            */
  185. /* FREE is used to free buffers allocated with MALLOC                        */
  186. /* LMALLOC is used for allocations of possibly larger than 64k                */
  187. /* LFREE is used to free buffers allocated with LMALLOC                     */
  188. /* REALLOC is used to re-size a previously MALLOCed or LMALLOCed buffer     */
  189. /****************************************************************************/
  190. #if defined(__COMPACT__) || defined(__LARGE__) || defined(__HUGE__)
  191.     #if defined(__TURBOC__)
  192.         #define REALLOC(x,y) farrealloc(x,y)
  193.         #define LMALLOC(x) farmalloc(x)
  194.         #define MALLOC(x) farmalloc(x)
  195.         #define LFREE(x) farfree(x)
  196.         #define FREE(x) farfree(x)
  197.     #elif defined(__WATCOMC__)
  198.         #define REALLOC realloc
  199.         #define LMALLOC(x) halloc(x,1)    /* far heap, but slow */
  200.         #define MALLOC malloc            /* far heap, but 64k max */
  201.         #define LFREE hfree
  202.         #define FREE free
  203.     #else    /* Other 16-bit Compiler */
  204.         #define REALLOC realloc
  205.         #define LMALLOC malloc
  206.         #define MALLOC malloc
  207.         #define LFREE free
  208.         #define FREE free
  209.     #endif
  210. #else        /* 32-bit Compiler or Small Memory Model */
  211.     #define REALLOC realloc
  212.     #define LMALLOC malloc
  213.     #define MALLOC malloc
  214.     #define LFREE free
  215.     #define FREE free
  216. #endif
  217.  
  218. #define KEY_BUFSIZE 256
  219.  
  220. #define CRLF  { outchar(CR); outchar(LF); }
  221.  
  222. #define SYSOP (user_level>=sysop_level) /* Is current user sysop t/f macro     */
  223.  
  224. #define bgotoxy(x,y)    printf("\x1b[%d;%dH",y,x)   /* place the cursor at   */
  225.                                                     /* location x,y via ANSI */
  226.  
  227. #define SAVELINE        slatr[slcnt]=latr; \
  228.                         sprintf(slbuf[slcnt<SAVE_LINES ? slcnt++ : slcnt] \
  229.                             ,"%.*s",lbuflen,lbuf)
  230. #define RESTORELINE     attr(slatr[--slcnt]); bputs(slbuf[slcnt])
  231.  
  232. /************/
  233. /* Typedefs */
  234. /************/
  235.  
  236. typedef struct {                        /* Node information kept in NODE.DAB */
  237.     uchar    status,                        /* Current Status of Node */
  238.             errors,                        /* Number of Critical Errors */
  239.             action;                        /* Action User is doing on Node */
  240.     uint    useron,                        /* User on Node */
  241.             connection,                    /* Connection rate of Node */
  242.             misc,                        /* Miscellaneous bits for node */
  243.             aux;                        /* Auxillary word for node */
  244.     ulong    extaux;                        /* Extended aux dword for node */
  245.             } node_t;
  246.  
  247. #endif    /* Don't add anything after this endif */
  248.